package cn.kgc.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author kk
 * @version 1.0
 * 对应的是ES中简历索引
 */
@Data
@Document(indexName = "resume")
public class ResumeEo {
    @Field(type = FieldType.Keyword)
    private String userId;

    @Field(type = FieldType.Keyword)
    private String resumeId;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String nickName;

    @Field(type = FieldType.Integer)
    private Integer sex;

    @Field(type=FieldType.Keyword)
    private String face;

    @Field(type=FieldType.Date, format = DateFormat.basic_date_time)
    private String birthday;

    @Field(type = FieldType.Integer)
    private Integer age;

    @Field(type=FieldType.Text, analyzer = "ik_max_word")
    private String companyName;

    @Field(type=FieldType.Text, analyzer = "ik_max_word")
    private String position;

    @Field(type=FieldType.Text, analyzer = "ik_max_word")
    private String industry;

    @Field(type=FieldType.Integer)
    private Integer workYears;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String school;

    @Field(type = FieldType.Keyword)
    private String eduction;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String major;

    /**
     * 简历求职的期望ID,一份简历有多个求职期望。在ES中每个求职期望对应的一个简历的对象（ResumeEo）。
     * 所以求职期望的ID是ES索引中的主键
     */
    @Id
    private String resumeExpectId;

    @Field(type=FieldType.Text, analyzer = "ik_max_word")
    private String jobType;

    @Field(type=FieldType.Keyword)
    private String city;

    @Field(type=FieldType.Integer)
    private Integer beginSalary;

    @Field(type=FieldType.Integer)
    private Integer endSalary;

    @Field(type=FieldType.Text, analyzer = "ik_max_word")
    private String skills;

    @Field(type=FieldType.Text, analyzer = "ik_max_word")
    private String advantage;

    @Field(type=FieldType.Keyword)
    private String advantageHTML;

    @Field(type=FieldType.Text, analyzer = "ik_max_word")
    private String credentials;

    @Field(type=FieldType.Keyword)
    private String jobStatus;

    /**
     * 简历刷新时间
     */
    @Field(type=FieldType.Date,format = DateFormat.basic_date_time)
    private String refreshTime;

    /**
     * HR收藏简历的时间
     */
    @Field(type=FieldType.Date,format = DateFormat.basic_date_time)
    private String hrCollectResumeTime;

    /**
     * HR查看简历的时间
     */
    @Field(type=FieldType.Date,format = DateFormat.basic_date_time)
    private String hrReadResumeTime;
}